home *** CD-ROM | disk | FTP | other *** search
/ Teach Your Children: Road Construction Ahead / Teach Your Children: Road Construction Ahead.iso / pc / rca / road.dxr / 00035_Help Parent.ls < prev    next >
Encoding:
Text File  |  1996-07-17  |  776 b   |  32 lines

  1. property soundName, soundState, buttonObject
  2. global gActorList, gMenuObject, gHelpObject, gCDpath, gFileSep
  3.  
  4. on birth me, helpButtonObject, sectionName
  5.   set soundState to #off
  6.   set soundName to getProp(the helpList of gMenuObject, sectionName)
  7.   set the mouseDownScript to "stopHelpSound"
  8.   set buttonObject to helpButtonObject
  9.   hideActor(buttonObject)
  10.   set gHelpObject to me
  11.   add(gActorList, gHelpObject)
  12. end
  13.  
  14. on update me
  15.   if not soundBusy(1) then
  16.     if soundState = #off then
  17.       sound playFile 1, gCDpath & "SOUND" & gFileSep & "HELP" & gFileSep & soundName
  18.       set soundState to #on
  19.     else
  20.       stopSound(me)
  21.     end if
  22.   end if
  23. end
  24.  
  25. on stopSound me
  26.   sound stop 1
  27.   set the mouseDownScript to EMPTY
  28.   clearActor(me)
  29.   showAllActors()
  30.   dontPassEvent()
  31. end
  32.